home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
T-COMAL Today
/
(k)t6.d64
/
restore'lbl.proc
< prev
next >
Wrap
Text File
|
2007-02-28
|
1KB
|
45 lines
9000 //
9010 PROC RESTORE'LABEL(NAME$) CLOSED
9020 LABEL'LENGTH:=LEN(NAME$)
9030 FOUND:=FALSE
9040 ADDRESS:=PEEK(60)+256*PEEK(61)
9050 NAME'END:=PEEK(62)+256*PEEK(63)
9060 COUNTER:=0
9070 REPEAT
9080 THIS'LENGTH:=PEEK(ADDRESS)
9090 IF THIS'LENGTH=LABEL'LENGTH THEN
9100 FOUND:=TRUE
9110 FOR I:=1 TO LABEL'LENGTH DO
9120 IF PEEK(ADDRESS+I)<>ORD(NAME$(I)) THEN FOUND:=FALSE
9130 ENDFOR I
9140 ENDIF
9150 IF FOUND=FALSE THEN
9160 ADDRESS:+THIS'LENGTH+1
9170 COUNTER:+1
9180 ENDIF
9190 UNTIL FOUND=TRUE OR ADDRESS>NAME'END
9200 IF FOUND=FALSE THEN
9210 PRINT
9220 PRINT "┼RROR! ╠ABEL ",NAME$," NOT FOUND."
9230 ELSE
9240 ADDRESS:=PEEK(58)+256*PEEK(59)+COUNTER*5
9250 IF PEEK(ADDRESS)<>19 THEN
9260 PRINT
9270 PRINT "┼RROR! ╠ABEL ",NAME$," NOT FOUND."
9280 END
9290 ELSE
9300 DATA'ADDRESS:=PEEK(ADDRESS+1)+256*PEEK(ADDRESS+2)+5
9310 IF PEEK(DATA'ADDRESS+3)=170 THEN
9320 POKE 251,DATA'ADDRESS MOD 256
9330 POKE 252,DATA'ADDRESS DIV 256
9340 POKE 253,4
9350 ELSE
9360 PRINT
9370 PRINT "┼RROR! ╠ABEL ",NAME$," NOT FOLLOWED BY"
9380 PRINT "DATA STATEMENT."
9390 END
9400 ENDIF
9410 ENDIF
9420 ENDIF
9430 ENDPROC RESTORE'LABEL